package team.seekers.oj.codetest.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import org.hibernate.validator.constraints.Length;
import team.seekers.oj.common.entity.BaseDTO;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class CodeTestManageDTO extends BaseDTO {

    private Long id;

    @Length(max = 60, message = "标题最大长度为 60")
    @NotBlank
    @NotNull
    private String name;

    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Long userId;

    @NotNull
    private Integer type;

    @NotNull
    private Integer deleted;

    @NotNull
    @Size(max = 1024, message = "最多支持 1024 个问题")
    private List<Long> problems; // List<problemId>

    @NotNull
    private List<Long> users; // List<userId>


    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Date gmtCreate;

    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Date gmtModified;

}
